--娇学渊鼘
local jiaoxueyuanyuan = fk.CreateSkill {
    name = "mcdh_jiaoxueyuanyuan",
}

local U = require "packages/utility/utility"
local lib = require "packages/mcdh/lib"

jiaoxueyuanyuan:addEffect(fk.Damaged,{
    can_trigger = function(self, event, target, player, data)
        return player:hasSkill(self) and target == player
    end,
    on_cost = function(self, event, target, player, data)
        return player.room:askForSkillInvoke(player, self.name)
    end,
    on_use = function(self, event, target, player, data)
        local room = player.room
        local judge = {
            who = player,
            reason = self.name,
            pattern = ".",
            skipDrop = true,
        }
        room:judge(judge)
        room:obtainCard(player, judge.card)
        room:askForYiji(
                player,
                table.filter(
                        player:getCardIds("he"),
                        function(id)
                            return Fk:getCardById(id).suit == judge.card.suit
                        end
                ),
                room:getOtherPlayers(player, false),
                self.name,
                0, nil,
                "#mcdh_jiaoxueyuanyuan-choice"
        )
    end
})

Fk:loadTranslationTable {
    ["mcdh_jiaoxueyuanyuan"] = "妙学",
    [":mcdh_jiaoxueyuanyuan"] = "『娇学渊鼘(yuān)』<br>当你受到伤害后，你可以判定并获得判定牌，然后你可以将任意张与之花色相同的牌并交给其他角色。",
    ["#mcdh_jiaoxueyuanyuan-choice"] = "娇学渊鼘：你可以将与判定结果花色相同的任意张牌分配出去",
}

return jiaoxueyuanyuan